﻿using HDS.Model;
using HDS.Model.Entity.Master;
using HDS.SupplierApi.Core.Entity;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace HDS.SupplierApi.Core
{
    /// <summary>
    /// 供应商酒店API
    /// </summary>
    public interface ISupplierHotelApi
    {
        /// <summary>
        /// 加载API配置信息
        /// </summary>
        /// <param name="config"></param>
        void LoadApiConfig(SupplierApiConfig config);

        /// <summary>
        /// 搜索多个酒店ID
        /// </summary>
        /// <param name="supplierHotelIds"></param>
        /// <param name="checkinDate"></param>
        /// <param name="checkoutDate"></param>
        /// <param name="roomGuest"></param>
        /// <param name="trackId"></param>
        /// <param name="cancelToken"></param>
        /// <returns></returns>
        Task<ResultData<List<SupplierRate>>> SearchRate(string[] supplierHotelIds, DateTime checkinDate, DateTime checkoutDate, RoomGuest roomGuest, string trackId, CancellationToken cancelToken);

        /// <summary>
        /// 搜索单个酒店ID
        /// </summary>
        /// <param name="supplierHotelId"></param>
        /// <param name="checkinDate"></param>
        /// <param name="checkoutDate"></param>
        /// <param name="roomGuest"></param>
        /// <param name="trackId"></param>
        /// <param name="cancelToken"></param>
        /// <returns></returns>
        Task<ResultData<List<SupplierRate>>> SearchRate(string supplierHotelId, DateTime checkinDate, DateTime checkoutDate, RoomGuest roomGuest, string trackId, CancellationToken cancelToken);

        /// <summary>
        /// 价格确认
        /// </summary>
        /// <param name="supplierHotelId"></param>
        /// <param name="checkinDate"></param>
        /// <param name="checkoutDate"></param>
        /// <param name="roomGuest"></param>
        /// <param name="ratePlanId"></param>
        /// <param name="trackId"></param>
        /// <param name="orderId"></param>
        /// <param name="cancelToken"></param>
        /// <returns></returns>
        Task<ResultData<SupplierRate>> ConfirmRate(string supplierHotelId, DateTime checkinDate, DateTime checkoutDate, RoomGuest roomGuest, string ratePlanId, string trackId, string orderId, CancellationToken cancelToken);

        /// <summary>
        /// 预订
        /// </summary>
        /// <param name="supplierRate"></param>
        /// <param name="checkinDate"></param>
        /// <param name="checkoutDate"></param>
        /// <param name="roomGuest"></param>
        /// <param name="orderId"></param>
        /// <param name="guestRequest"></param>
        /// <param name="cancelToken"></param>
        /// <returns></returns>
        Task<ResultData<SupplierOrderInfo>> Reservation(SupplierRate supplierRate, DateTime checkinDate, DateTime checkoutDate, RoomGuest roomGuest, string orderId, string guestRequest, CancellationToken cancelToken);

        /// <summary>
        /// 取消预订
        /// </summary>
        /// <param name="spplierOrderId"></param>
        /// <param name="orderId"></param>
        /// <param name="extras"></param>
        /// <param name="cancelToken"></param>
        /// <returns></returns>
        Task<ResultData<SupplierOrderInfo>> Cancel(string spplierOrderId, string orderId, Dictionary<string, string> extras, CancellationToken cancelToken);

        /// <summary>
        /// 获取预订信息
        /// </summary>
        /// <param name="spplierOrderId"></param>
        /// <param name="orderId"></param>
        /// <param name="extras"></param>
        /// <param name="cancelToken"></param>
        /// <returns></returns>
        Task<ResultData<SupplierOrderInfo>> GetOrder(string spplierOrderId, string orderId, Dictionary<string, string> extras, CancellationToken cancelToken);

    }
}
